<template>
  <view class="content">
    <u-cell-group>
      <u-cell title="客户名称" :value="info.nickname"></u-cell>
      <u-cell title="性别" :value="info.gender_text"></u-cell>
      <u-cell title="客户来源" :value="info.source.name"></u-cell>
      <u-cell title="成交状态" :value="info.deal_text"></u-cell>
      <u-cell
        title="创建时间"
        :value="$u.timeFormat(info.createtime, 'yyyy年mm月dd日 hh:MM')"
      ></u-cell>
      <u-cell title="地区" :value="info.region_text"></u-cell>
    </u-cell-group>

    <u-toast ref="uToast"></u-toast>
  </view>
</template>
<script>
export default {
  data() {
    return {
      info: {
        source: {},
      },
      id: 0,
    };
  },
  onLoad(option) {
    this.id = option.busid ? option.busid : 0;

    this.getInfoData();
  },
  methods: {
    async getInfoData() {
      let result = await this.$u.api.manage.highseaInfo({ busid: this.id });

      if (result.code === 0) {
        this.$refs.uToast.show({
          type: "error",
          message: result.msg,
          duration: 1500,
          complete: () => {
            this.$u.route("/pages/manage/highsea/index/index");
          },
        });
      }

      this.info = result.data;
    },
  },
};
</script>